<script type="text/javascript">
var refreshId = setInterval(function(){
     $('#wrap-enchere').load('detail.php?id=<?php echo $link->getData('id'); ?>');
}, 1000);
</script>
<div id="pagefull">
    <div id="enchere">
        <?php foreach($detailObj as $enchers):  ?>
        <div id="detail-prod"><img alt="<?php  echo $enchers->getNom(); ?>" src="<?php  echo _UPLOAD_DIR_ ?>encheres/<?php echo $enchers->getImages(); ?>" /></div>
        <div id="wrap-enchere">
            <div id="<?php echo $type ?>-prod">
                <div class="icons">
                    <div class="iconu">
                        <span class="rt"><?php echo $enchers->getRetime(); ?></span>
                    </div>
                    <div class="iconu">
                        <span class="pc<?php echo $pc ?>"><?php  echo $enchers->getLimite(); ?>%</span>
                    </div>
                    <div class="iconu">
                        <span class="ae<?php echo $ae ?>"><?php  echo $enchers->getAe(); ?></span>
                    </div>
                </div>
                <div class="titre"><?php  echo $enchers->getNom(); ?></div>
                <div class="temps">
                    <?php if( $site->getHourClose() <= date('H:i:s') OR $site->getHourOpen() >= date('H:i:s')): ?>
                        EN PAUSE
                    <?php else: ?>
                        <?php echo $timeEn ?>
                    <?php endif; ?>
                </div>
                <div class="enchere<?php echo (float)$enchers->getEnchere()>(float)($enchers->getPrix()*$enchers->getLimite()/100)?' enchere_g':'' ?>"><?php  $valEnchere = $enchers->getEnchere(); echo $enchers->getEnchere(); ?> <?php  echo $site->getDevise(); ?></div>
                <div class="encherir">
                    <?php if($timeEn == _TERMINE_): ?>
                        <img src="<?php  echo _THEME_IMG_DIR_ ?>big-terminee.jpg" alt="Indisponible" />
                    <?php else: ?>
                        <?php if( $site->getHourClose() <= date('H:i:s') OR $site->getHourOpen() >= date('H:i:s')): ?>
                            <img src="<?php  echo _THEME_IMG_DIR_ ?>big-avenir.jpg" alt="Indisponible" />
                        <?php elseif($user->isAuthenticated() AND $enchers->getMeneur() == $user->getId()): ?>
                            <img src="<?php  echo _THEME_IMG_DIR_ ?>bt-meneur.jpg" alt="Meneur" />
                        <?php else: ?>
                            <a class="encherir-elt" href="#" id="encherir-<?php  echo $enchers->getId().'-'.($user->isAuthenticated()?intval($user->getId()):0); ?>"><img src="<?php  echo _THEME_IMG_DIR_ ?>big-encherir.jpg" alt="Ench&eacute;rir" /></a>
                        <?php endif; ?>
                    <?php endif; ?>
                </div>
                <div class="infos">
                    <?php if( $type == 'termine' ): ?>
                        <span class="meneur"><?php echo _GAGNANT_ ?></span> <span class="pseudo"><?php  echo $enchers->getPseudo(); ?></span>
                    <?php elseif($type == 'avenir'): ?>
                        <div class="prix"><?php echo _PRIX_MAGASIN_ ?><?php  echo $enchers->getPrix(); ?> &euro;</div>
                    <?php else: ?>
                        <div class="prix"><?php echo _PRIX_MAGASIN_ ?><?php  echo $enchers->getPrix(); ?> &euro;</div>
                        <span class="meneur"><?php echo _MENEUR_ ?></span> <span class="pseudo"><?php  echo $enchers->getPseudo(); ?></span>
                    <?php endif; ?>
                </div>
            </div>
            <div class="clear"></div>
        </div>
        <div class="clear"></div>
        <?php endforeach; ?>
    </div>
    <div id="wrap-img">
        <?php if(isset($tabimg)):?>
            <?php foreach ($tabimg as $value):?>
                <div class="img-prod"><img alt="" src="<?php  echo _UPLOAD_DIR_ ?>encheres/<?php  echo $value ?>"></div>
            <?php endforeach;?>
        <?php endif;?>
        <div class="clear"></div>
    </div>
    <div id="description-prod"><?php echo $description ?></div>
    <div id="historique-prod">
       <?php if( !empty($historique) ): ?>
        <?php $i = 1; $valEnchere = str_replace (',', '.', $valEnchere);?>
        <table>
            <?php foreach ($historique as $encherisseur):?>
            <?php 
                if( $i != 1 ) $valEnchere -= 0.01;
                if( strlen($valEnchere) == 3 ) $valEnchere .= 0;
            ?>
            <tr>
                <td><?php echo $encherisseur['pseudo'];?></td>
                <td><?php echo $encherisseur['mois'];?></td>
                <td><?php echo $encherisseur['heure'];?></td>
                <td><?php echo $valEnchere;?></td>
            </tr>
            <?php $i++; ?>
            <?php $i++; endforeach;?>
        </table>
       <?php else: ?>
            <p>Soyez le premier !</p>
       <?php endif;?>
        
    </div>
    <div class="clear"></div>
</div>
<div class="clear"></div>
